this.BX=this.BX||{};this.BX.Landing=this.BX.Landing||{};this.BX.Landing.UI=this.BX.Landing.UI||{};(function(t,i,e,n,a){"use strict";var d,l;var c=function(t){babelHelpers.inherits(i,t);function i(t){var e;babelHelpers.classCallCheck(this,i);e=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(i).call(this,t));e.setEventNamespace("BX.Landing.UI.Field.AccordionField");n.Dom.addClass(e.layout,"landing-ui-field-accordion");n.Dom.replace(e.input,e.getItemsContainer());e.items=[];t.items.forEach((function(t){e.addItem(t)}));return e}babelHelpers.createClass(i,[{key:"getItemsContainer",value:function t(){return this.cache.remember("itemsContainer",(function(){return n.Tag.render(d||(d=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-ui-field-accordion-items-container"></div>\n\t\t\t'])))}))}},{key:"onTitleClick",value:function t(i){i.preventDefault();var e=i.currentTarget.closest(".landing-ui-field-accordion-item");if(n.Dom.hasClass(e,"landing-ui-field-accordion-item-active")){n.Dom.toggleClass(e,"landing-ui-field-accordion-item-opened")}}},{key:"createItem",value:function t(i){var e=new a.SmallSwitch({value:n.Text.toBoolean(i.checked),onValueChange:function t(){var i=e.layout.closest(".landing-ui-field-accordion-item");if(e.getValue()){n.Dom.addClass(i,"landing-ui-field-accordion-item-active")}else{n.Dom.removeClass(i,"landing-ui-field-accordion-item-active");n.Dom.removeClass(i,"landing-ui-field-accordion-item-opened")}}});return n.Tag.render(l||(l=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<div class="landing-ui-field-accordion-item landing-ui-field-accordion-item-active" data-id="','">\n\t\t\t\t<div class="landing-ui-field-accordion-item-header">\n\t\t\t\t\t<div class="landing-ui-field-accordion-item-header-icon" style="background-image: url(',')"></div>\n\t\t\t\t\t<div \n\t\t\t\t\t\tclass="landing-ui-field-accordion-item-header-title"\n\t\t\t\t\t\tonclick="','"\n\t\t\t\t\t>','</div>\n\t\t\t\t\t<div \n\t\t\t\t\t\tclass="landing-ui-field-accordion-item-header-switch"\n\t\t\t\t\t\tstyle="','"\n\t\t\t\t\t>\n\t\t\t\t\t\t<div class="landing-ui-field-accordion-item-header-switch-link"></div>\n\t\t\t\t\t\t','\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="landing-ui-field-accordion-item-body">\n\t\t\t\t\t',"\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t"])),i.id,i.icon,this.onTitleClick.bind(this),i.title,i.switcher===false?"display: none;":"",e.layout,i.content)}},{key:"addItem",value:function t(i){var e=this.createItem(i);n.Dom.append(e,this.getItemsContainer())}}]);return i}(e.BaseField);t.AccordionField=c})(this.BX.Landing.UI.Field=this.BX.Landing.UI.Field||{},BX,BX.Landing.UI.Field,BX,BX.Landing.UI.Field);
//# sourceMappingURL=accordionfield.bundle.map.js